from django.urls import path
from . import views

app_name = 'spare_parts'

urlpatterns = [
    # 库存管理
    path('inventory/', views.inventory_list, name='inventory_list'),
    path('inventory/<int:pk>/', views.inventory_detail, name='inventory_detail'),
    path('inventory/add/', views.inventory_add, name='inventory_add'),
    path('inventory/<int:pk>/edit/', views.inventory_edit, name='inventory_edit'),
    
    # 使用记录
    path('usage/', views.usage_list, name='usage_list'),
    path('usage/add/', views.usage_add, name='usage_add'),
    
    # 采购管理
    path('purchase/', views.purchase_list, name='purchase_list'),
    path('purchase/add/', views.purchase_add, name='purchase_add'),
    path('purchase/<int:pk>/', views.purchase_detail, name='purchase_detail'),
    path('purchase/<int:pk>/edit/', views.purchase_edit, name='purchase_edit'),
    path('purchase/<int:pk>/approve/', views.purchase_approve, name='purchase_approve'),
    path('purchase/<int:pk>/receive/', views.purchase_receive, name='purchase_receive'),
    
    # 供应商管理
    path('suppliers/', views.supplier_list, name='supplier_list'),
    path('suppliers/add/', views.supplier_add, name='supplier_add'),
    path('suppliers/<int:pk>/edit/', views.supplier_edit, name='supplier_edit'),
    
    # 分类管理
    path('categories/', views.category_list, name='category_list'),
    path('categories/add/', views.category_add, name='category_add'),
    path('categories/<int:pk>/edit/', views.category_edit, name='category_edit'),
    
    # SKU管理
    path('sku/', views.sku_management, name='sku_management'),
    path('sku/add/', views.sku_add, name='sku_add'),
    path('sku/<int:pk>/edit/', views.sku_edit, name='sku_edit'),
    path('sku/<int:pk>/delete/', views.sku_delete, name='sku_delete'),
    path('sku/<int:pk>/', views.sku_detail, name='sku_detail'),
]
